﻿import QtQuick 2.0
Item
{
    id:appDate
    width: 326
    height: 640
    property string trackName :""
    property string trackHeig :""
    property string trackPeri :""
    property string trackCycl :""
    property bool reseVa: false
    property bool reseVale: false
    property bool resePa: false
    property bool resePale: false
    Image {

        source: "./切图/卫星面板/底子.png"
        anchors.fill: parent
    }
    Image {
        anchors.right: parent.right
        anchors.rightMargin: 15
        anchors.top: parent.top
        anchors.topMargin: 10
        source: "./切图/卫星面板/关闭-拷贝-2.png"
        MouseArea
        {
            anchors.fill: parent
            onClicked:
            {
                appDate.visible = false
                emit: closeSatelLitePanel()

            }

        }
    }
    Item
    {
        anchors.top:  parent.top
        anchors.topMargin: 28
        anchors.left: parent.left
        anchors.leftMargin: 15
        anchors.fill: parent
        Column {
            spacing: 10

            Image {

                source: "./切图/卫星面板/卫星名称.png"
                Text
                {
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.horizontalCenter: parent.horizontalCenter
                    text:trackName
                    font.family: "微软雅黑"
                    font.pixelSize: 26
                    color: "white"
                }
            }
            Image {

                source: "./切图/卫星面板/轨道高度.png"
                Text
                {
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.left: parent.left
                    anchors.leftMargin:  10
                    text:trackHeig
                    font.family: "微软雅黑"
                    font.pixelSize: 16
                    color: "white"
                }
            }
            Image {

                source: "./切图/卫星面板/轨道倾角.png"
                Text
                {
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.left: parent.left
                    anchors.leftMargin:  10
                    text:trackPeri
                    font.family: "微软雅黑"
                    font.pixelSize: 16
                    color: "white"
                }
            }
            Image {

                source: "./切图/卫星面板/轨道周期.png"
                Text
                {
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.left: parent.left
                    anchors.leftMargin:  10
                    text:trackCycl
                    font.family: "微软雅黑"
                    font.pixelSize: 16
                    color: "white"
                }
            }
            Image {

                source: "./切图/卫星面板/作用意义.png"
                Text
                {
                    anchors.left: parent.left
                    anchors.leftMargin:  10
                    anchors.top: parent.top
                    anchors.topMargin: 10
                    text:"作用意义: 提供天气、台风、暴雨、气候
                变化、预测等相关之报告。"
                    font.family: "微软雅黑"
                    lineHeight: 1.6
                    font.pixelSize: 16
                    color: "white"
                    wrapMode: Text.Wrap
                }
            }
            Image {

                source: "./切图/卫星面板/拍摄图像.png"
                Text
                {
                    id:takePic
                    anchors.top: parent.top
                    anchors.topMargin: 10
                    anchors.left: parent.left
                    anchors.leftMargin:  10
                    text:"拍摄图像："
                    font.family: "微软雅黑"
                    font.pixelSize: 16
                    color: "white"
                }
               Item
               {
                   id:beatItem
                   width:parent.width - 40
                   height:parent.height - takePic.height -20
                   anchors.top:takePic.bottom
                   anchors.topMargin: 10
                   anchors.left: parent.left
                   anchors.leftMargin: 20
                   anchors.bottom: parent.bottom
                   anchors.bottomMargin: 20
                   clip:true
                   Image
                   {
                       source: "./切图/卫星面板/01D1.png"
                       width:parent.width
                       height:parent.height
                       id:image
                       visible: false
                   }
                   Image
                   {
                       source: "./切图/卫星面板/02D2.png"
                       width:parent.width
                       height:parent.height
                       id:image2
                        visible: false
                   }
                   ParallelAnimation
                   {
                       id:rese01
                       NumberAnimation
                       {
                           target: image
                           property: "y"
                           from:-beatItem.width + 85
                           to:196
                           duration: 9000
                           easing.type: Easing.Linear
                           loops:1
                       }
                       onStopped:
                       {
                           reseVa =true
                           rese03.start()
                       }
                   }
                   ParallelAnimation
                   {
                       id:rese02
                       onStopped:
                       {
                           reseVale = true
                           rese04.start()
                       }
                       NumberAnimation
                       {
                           target: image2
                           property: "y"
                           from:-beatItem.width + 85 -image.height
                           to:196
                           duration: 13900
                           easing.type: Easing.Linear
                           loops:1
                       }
                   }
                   ParallelAnimation
                   {
                       id:rese03
                       NumberAnimation
                       {
                           id:zyuz
                           target: image
                           property: "y"
                           from:-beatItem.width +56
                           to:196
                           duration: 9800
                           easing.type: Easing.Linear
                           loops:Animation.Infinite
                       }
                   }
                   ParallelAnimation
                   {
                       id:rese04
                       NumberAnimation
                       {
                           id:tttttzs
                           target: image2
                           property: "y"
                           from:-beatItem.width + 56
                           to:196
                           duration: 9800
                           easing.type: Easing.Linear
                           loops:Animation.Infinite
                       }
                   }
               }

            }
        }
    }


    function xingXi(i)
    {
        switch(i)
        {
        case "modies aqua" :
            trackName = "Modies Aqua"
            trackHeig = "轨道高度:705km"
            trackPeri = "轨道倾角:98°"
            trackCycl = "轨道周期:101.2min"
            break;
        case "modies terra" :
            trackName = "Modies Terra"
            trackHeig = "轨道高度:705km"
            trackPeri = "轨道倾角:98°"
            trackCycl = "轨道周期:101.2min"
            break;
        case "modies aura" :
            trackName = "Modies Aura"
            trackHeig = "轨道高度:705km"
            trackPeri = "轨道倾角:98°"
            trackCycl = "轨道周期:101.2min"
            break;
        case "noaa19" :
            trackName = "NOAA-19"
            trackHeig = "轨道高度:850km"
            trackPeri = "轨道倾角:98.9°"
            trackCycl = "轨道周期:101.99min"
            break;
        case "noaa18" :
            trackName = "NOAA-18"
            trackHeig = "轨道高度:854km"
            trackPeri = "轨道倾角:99°"
            trackCycl = "轨道周期:102min"
            break;
        case "noaa17" :
            trackName = "NOAA-17"
            trackHeig = "轨道高度:811km"
            trackPeri = "轨道倾角:98.7°"
            trackCycl = "轨道周期:101.2min"
            break;
        case "noaa16" :
            trackName = "NOAA-16"
            trackHeig = "轨道高度:850km"
            trackPeri = "轨道倾角:98.9°"
            trackCycl = "轨道周期:102.1min"
            break;
        case "noaa15" :
            trackName = "NOAA-15"
            trackHeig = "轨道高度:808km"
            trackPeri = "轨道倾角:98.6°"
            trackCycl = "轨道周期:101.2min"
            break;
        case "noaa14" :
            trackName = "NOAA-14"
            trackHeig = "轨道高度:845km"
            trackPeri = "轨道倾角:99.1°"
            trackCycl = "轨道周期:101.9min"
            break;
        case "葵花9" :
            trackName = "葵花9号"
            trackHeig = "轨道高度:808km"
            trackPeri = "轨道倾角:98.6°"
            trackCycl = "轨道周期:24h"
            break;
        case "葵花8" :
            trackName = "葵花8号"
            trackHeig = "轨道高度:3.58万km"
            trackPeri = "轨道倾角:东经 140°"
            trackCycl = "轨道周期:24h"
            break;
        }
        //        rese01.start()
        //        rese02.start()
    }
    function open()
    {
        image.visible=true
        image2.visible = true
        if(reseVa ===false)
        {
            if(resePa ===false)
            {
                rese01.start()
            }else
            {
                rese01.resume()
            }
        }else
        {
            if(resePale ===false)
            {
                rese03.start()
            }else
            {
                rese03.resume()
            }
        }
        if(reseVale ===false)
        {
            if(resePa ===false)
            {
                rese02.start()
            }else
            {
                rese02.resume()
            }
        }else
        {
            if(resePale ===false)
            {
                rese04.start()
            }else
            {
                rese04.resume()
            }
        }
    }
    function parsex()
    {

        if(reseVa ===false)
        {
            rese01.pause()
            resePa = true
        }else
        {
            rese03.pause()
            resePale = true
        }

        if(reseVale ===false)
        {
            rese02.pause()
            resePa = true
        }else
        {
            rese04.pause()
            resePale = true
        }

    }


}
